package org.lucky_common.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("t_user")
public class User extends Model<User> {
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;
    @NotBlank(message = "姓名不能为空")
    @TableField("uname")
    private String uname;
    @NotBlank(message = "省份不能为空")
    @TableField("province")
    private String province;
    @NotBlank(message = "城市不能为空")
    @TableField("city")
    private String city;
    @NotBlank(message = "地址不能为空")
    @TableField("address")
    private String address;
    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    @TableField("email")
    private String email;
    @NotBlank(message = "电话不能为空")
    @Size(min = 6, max = 20, message = "电话号码不得少于6位,最多20位")
    @TableField("mobile")
    private String mobile;
    @TableField("inviteCode")
    private String inviteCode;
    @TableField("data")
    private String data;
}
